package com.xtq.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author: xietianqi
 * @create: 2024-01-23 09:34
 * @description: 配置注入RestTemplate bean 对象
 **/
@Configuration
public class CustomizationBean {
	// 注入RestTemplate 的 bean
	@Bean
	@LoadBalanced // 负载均衡算法配置 默认是使用轮询算法
	public RestTemplate getRestTemplate() {
		return new RestTemplate();
	}
}
